winsafe\user\handles/
hcursor.rs1#![allow(non_camel_case_types, non_snake_case)]
2
3use crate::co;
4use crate::decl::*;
5use crate::guard::*;
6use crate::kernel::privs::*;
7use crate::user::ffi;
8
9handle! { HCURSOR;
10 }
13
14impl HCURSOR {
15 #[must_use]
18 pub fn CopyCursor(&self) -> SysResult<DestroyCursorGuard> {
19 unsafe {
20 ptr_to_sysresult_handle(ffi::CopyIcon(self.ptr())).map(|h| DestroyCursorGuard::new(h))
21 }
22 }
23
24 #[must_use]
27 pub fn GetCursor() -> Option<HCURSOR> {
28 ptr_to_option_handle(unsafe { ffi::GetCursor() })
29 }
30
31 pub fn SetSystemCursor(&self, id: co::OCR) -> SysResult<()> {
34 bool_to_sysresult(unsafe { ffi::SetSystemCursor(self.ptr(), id.raw()) })
35 }
36}